#pragma once

#include "../umlmodel_global.h"

#include <memory>
#include <vector>

#include "ObjectNode.h"

using std::make_shared;
using std::shared_ptr;
using std::vector;

namespace uml {
class ExpansionRegion;

/// <summary>
/// ExpansionNode
/// An ExpansionNode is an ObjectNode used to indicate a collection input or output
/// for an ExpansionRegion. A collection input of an ExpansionRegion contains a
/// collection that is broken into its individual elements inside the region, whose
/// content is executed once per element. A collection output of an ExpansionRegion
/// combines individual elements produced by the execution of the region into a
/// collection for use outside the region.
/// </summary>
class UMLMODEL_EXPORT ExpansionNode : public ObjectNode {

public: // Constructors and destructors
    explicit ExpansionNode(const QString& umlType="uml::ExpansionNode");

public: // JsonSerializable override
    void fromJson(const QJsonObject& json, QStringList& errorList) override;
    void toJson(QJsonObject& json) override;

public: // Properties
    /// <summary>
    /// regionAsInput getter
    /// The ExpansionRegion for which the ExpansionNode is an input.
    /// </summary>
    shared_ptr<ExpansionRegion> regionAsInput() const;

    /// <summary>
    /// regionAsInput setter
    /// The ExpansionRegion for which the ExpansionNode is an input.
    /// </summary>
    void setRegionAsInput(shared_ptr<ExpansionRegion> value);

    /// <summary>
    /// regionAsOutput getter
    /// The ExpansionRegion for which the ExpansionNode is an output.
    /// </summary>
    shared_ptr<ExpansionRegion> regionAsOutput() const;

    /// <summary>
    /// regionAsOutput setter
    /// The ExpansionRegion for which the ExpansionNode is an output.
    /// </summary>
    void setRegionAsOutput(shared_ptr<ExpansionRegion> value);

private: // Fields
    /// <summary>
    /// regionAsInput
    /// The ExpansionRegion for which the ExpansionNode is an input.
    /// </summary>
    shared_ptr<ExpansionRegion> regionAsInput_;

    /// <summary>
    /// regionAsOutput
    /// The ExpansionRegion for which the ExpansionNode is an output.
    /// </summary>
    shared_ptr<ExpansionRegion> regionAsOutput_;

};

} // namespace uml
